package com.serene.im.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.serene.im.enums.HttpCode;
import com.serene.im.utils.JsonResult;
import com.serene.im.pojo.SysUser;
import com.serene.im.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 用户信息
 *
 * @author serence
 * @date 2021/3/18 15:55
 */

@RestController
@RequestMapping("/sysUser/")
public class SysUserController {

    @Autowired
    private SysUserService sysUserService;

    /**
     * 获得所有用户列表
     *
     * @param request
     * @return
     */
    @RequestMapping("selectAllList")
    public JsonResult<List<SysUser>> selectAllList(HttpServletRequest request) {
        QueryWrapper<SysUser> queryWrapper = new QueryWrapper<SysUser>();
        List<SysUser> infoList = sysUserService.list(queryWrapper);
        return new JsonResult<List<SysUser>>(infoList, HttpCode.SUCCESS);
    }

}
